package megrez.oss.local.web;

import java.util.Date;

import org.springframework.beans.BeanUtils;

import lombok.Data;
import megrez.oss.local.domain.Metadata;

/**
 * 元数据
 *  
 * @author Lucky Yang
 * @since 2.6.9
 */
@Data
public class MetadataVO {
    private String id;
    private Integer version;

    private String createdBy;
    private Date createdDate;
    /** 名称 */
    private String name;

    /** 文件路径 */
    private String path;

    /** 类型 */
    private String contentType;

    /** 大小，字节 */
    private Long size;

    public static MetadataVO withPO(final Metadata metadata) {
        MetadataVO rslt = new MetadataVO();
        BeanUtils.copyProperties(metadata, rslt);
        rslt.setPath(metadata.getPath().toString());
        return rslt;
    }

    @Override
    public boolean equals(Object o) {
        return super.equals(o);
    }

    @Override
    public int hashCode() {
        return super.hashCode();
    }

    
}
